3.688 \(\int (a+b \sin (e+f x))^3 (c+d \sin (e+f x)) \, dx\)

Optimal. Leaf size=171 \[ -\frac{\left (16 a^2 b c+3 a^3 d+12 a b^2 d+4 b^3 c\right ) \cos (e+f x)}{6 f}-\frac{b \left (6 a^2 d+20 a b c+9 b^2 d\right ) \sin (e+f x) \cos (e+f x)}{24 f}+\frac{1}{8} x \left (12 a^2 b d+8 a^3 c+12 a b^2 c+3 b^3 d\right )-\frac{(3 a d+4 b c) \cos (e+f x) (a+b \sin (e+f x))^2}{12 f}-\frac{d \cos (e+f x) (a+b \sin (e+f x))^3}{4 f} \]

[Out]

((8*a^3*c + 12*a*b^2*c + 12*a^2*b*d + 3*b^3*d)*x)/8 - ((16*a^2*b*c + 4*b^3*c + 3*a^3*d + 12*a*b^2*d)*Cos[e + f
*x])/(6*f) - (b*(20*a*b*c + 6*a^2*d + 9*b^2*d)*Cos[e + f*x]*Sin[e + f*x])/(24*f) - ((4*b*c + 3*a*d)*Cos[e + f*
x]*(a + b*Sin[e + f*x])^2)/(12*f) - (d*Cos[e + f*x]*(a + b*Sin[e + f*x])^3)/(4*f)

________________________________________________________________________________________

Rubi [A]  time = 0.197485, antiderivative size = 171, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.087, Rules used = {2753, 2734} \[ -\frac{\left (16 a^2 b c+3 a^3 d+12 a b^2 d+4 b^3 c\right ) \cos (e+f x)}{6 f}-\frac{b \left (6 a^2 d+20 a b c+9 b^2 d\right ) \sin (e+f x) \cos (e+f x)}{24 f}+\frac{1}{8} x \left (12 a^2 b d+8 a^3 c+12 a b^2 c+3 b^3 d\right )-\frac{(3 a d+4 b c) \cos (e+f x) (a+b \sin (e+f x))^2}{12 f}-\frac{d \cos (e+f x) (a+b \sin (e+f x))^3}{4 f} \]

Antiderivative was successfully verified.

[In]

Int[(a + b*Sin[e + f*x])^3*(c + d*Sin[e + f*x]),x]

[Out]

((8*a^3*c + 12*a*b^2*c + 12*a^2*b*d + 3*b^3*d)*x)/8 - ((16*a^2*b*c + 4*b^3*c + 3*a^3*d + 12*a*b^2*d)*Cos[e + f
*x])/(6*f) - (b*(20*a*b*c + 6*a^2*d + 9*b^2*d)*Cos[e + f*x]*Sin[e + f*x])/(24*f) - ((4*b*c + 3*a*d)*Cos[e + f*
x]*(a + b*Sin[e + f*x])^2)/(12*f) - (d*Cos[e + f*x]*(a + b*Sin[e + f*x])^3)/(4*f)

Rule 2753

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> -Simp[(d
*Cos[e + f*x]*(a + b*Sin[e + f*x])^m)/(f*(m + 1)), x] + Dist[1/(m + 1), Int[(a + b*Sin[e + f*x])^(m - 1)*Simp[
b*d*m + a*c*(m + 1) + (a*d*m + b*c*(m + 1))*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*
c - a*d, 0] && NeQ[a^2 - b^2, 0] && GtQ[m, 0] && IntegerQ[2*m]

Rule 2734

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[((2*a*c
+ b*d)*x)/2, x] + (-Simp[((b*c + a*d)*Cos[e + f*x])/f, x] - Simp[(b*d*Cos[e + f*x]*Sin[e + f*x])/(2*f), x]) /;
 FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0]

Rubi steps

\begin{align*} \int (a+b \sin (e+f x))^3 (c+d \sin (e+f x)) \, dx &=-\frac{d \cos (e+f x) (a+b \sin (e+f x))^3}{4 f}+\frac{1}{4} \int (a+b \sin (e+f x))^2 (4 a c+3 b d+(4 b c+3 a d) \sin (e+f x)) \, dx\\ &=-\frac{(4 b c+3 a d) \cos (e+f x) (a+b \sin (e+f x))^2}{12 f}-\frac{d \cos (e+f x) (a+b \sin (e+f x))^3}{4 f}+\frac{1}{12} \int (a+b \sin (e+f x)) \left (12 a^2 c+8 b^2 c+15 a b d+\left (20 a b c+6 a^2 d+9 b^2 d\right ) \sin (e+f x)\right ) \, dx\\ &=\frac{1}{8} \left (8 a^3 c+12 a b^2 c+12 a^2 b d+3 b^3 d\right ) x-\frac{\left (16 a^2 b c+4 b^3 c+3 a^3 d+12 a b^2 d\right ) \cos (e+f x)}{6 f}-\frac{b \left (20 a b c+6 a^2 d+9 b^2 d\right ) \cos (e+f x) \sin (e+f x)}{24 f}-\frac{(4 b c+3 a d) \cos (e+f x) (a+b \sin (e+f x))^2}{12 f}-\frac{d \cos (e+f x) (a+b \sin (e+f x))^3}{4 f}\\ \end{align*}

Mathematica [A]  time = 0.645167, size = 142, normalized size = 0.83 \[ \frac{3 \left (4 (e+f x) \left (12 a^2 b d+8 a^3 c+12 a b^2 c+3 b^3 d\right )-8 b \left (3 a^2 d+3 a b c+b^2 d\right ) \sin (2 (e+f x))+b^3 d \sin (4 (e+f x))\right )-24 \left (12 a^2 b c+4 a^3 d+9 a b^2 d+3 b^3 c\right ) \cos (e+f x)+8 b^2 (3 a d+b c) \cos (3 (e+f x))}{96 f} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + b*Sin[e + f*x])^3*(c + d*Sin[e + f*x]),x]

[Out]

(-24*(12*a^2*b*c + 3*b^3*c + 4*a^3*d + 9*a*b^2*d)*Cos[e + f*x] + 8*b^2*(b*c + 3*a*d)*Cos[3*(e + f*x)] + 3*(4*(
8*a^3*c + 12*a*b^2*c + 12*a^2*b*d + 3*b^3*d)*(e + f*x) - 8*b*(3*a*b*c + 3*a^2*d + b^2*d)*Sin[2*(e + f*x)] + b^
3*d*Sin[4*(e + f*x)]))/(96*f)

________________________________________________________________________________________

Maple [A]  time = 0.029, size = 182, normalized size = 1.1 \begin{align*}{\frac{1}{f} \left ({a}^{3}c \left ( fx+e \right ) -{a}^{3}d\cos \left ( fx+e \right ) -3\,{a}^{2}bc\cos \left ( fx+e \right ) +3\,{a}^{2}bd \left ( -1/2\,\sin \left ( fx+e \right ) \cos \left ( fx+e \right ) +1/2\,fx+e/2 \right ) +3\,a{b}^{2}c \left ( -1/2\,\sin \left ( fx+e \right ) \cos \left ( fx+e \right ) +1/2\,fx+e/2 \right ) -a{b}^{2}d \left ( 2+ \left ( \sin \left ( fx+e \right ) \right ) ^{2} \right ) \cos \left ( fx+e \right ) -{\frac{{b}^{3}c \left ( 2+ \left ( \sin \left ( fx+e \right ) \right ) ^{2} \right ) \cos \left ( fx+e \right ) }{3}}+{b}^{3}d \left ( -{\frac{\cos \left ( fx+e \right ) }{4} \left ( \left ( \sin \left ( fx+e \right ) \right ) ^{3}+{\frac{3\,\sin \left ( fx+e \right ) }{2}} \right ) }+{\frac{3\,fx}{8}}+{\frac{3\,e}{8}} \right ) \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*sin(f*x+e))^3*(c+d*sin(f*x+e)),x)

[Out]

1/f*(a^3*c*(f*x+e)-a^3*d*cos(f*x+e)-3*a^2*b*c*cos(f*x+e)+3*a^2*b*d*(-1/2*sin(f*x+e)*cos(f*x+e)+1/2*f*x+1/2*e)+
3*a*b^2*c*(-1/2*sin(f*x+e)*cos(f*x+e)+1/2*f*x+1/2*e)-a*b^2*d*(2+sin(f*x+e)^2)*cos(f*x+e)-1/3*b^3*c*(2+sin(f*x+
e)^2)*cos(f*x+e)+b^3*d*(-1/4*(sin(f*x+e)^3+3/2*sin(f*x+e))*cos(f*x+e)+3/8*f*x+3/8*e))

________________________________________________________________________________________

Maxima [A]  time = 1.08413, size = 236, normalized size = 1.38 \begin{align*} \frac{96 \,{\left (f x + e\right )} a^{3} c + 72 \,{\left (2 \, f x + 2 \, e - \sin \left (2 \, f x + 2 \, e\right )\right )} a b^{2} c + 32 \,{\left (\cos \left (f x + e\right )^{3} - 3 \, \cos \left (f x + e\right )\right )} b^{3} c + 72 \,{\left (2 \, f x + 2 \, e - \sin \left (2 \, f x + 2 \, e\right )\right )} a^{2} b d + 96 \,{\left (\cos \left (f x + e\right )^{3} - 3 \, \cos \left (f x + e\right )\right )} a b^{2} d + 3 \,{\left (12 \, f x + 12 \, e + \sin \left (4 \, f x + 4 \, e\right ) - 8 \, \sin \left (2 \, f x + 2 \, e\right )\right )} b^{3} d - 288 \, a^{2} b c \cos \left (f x + e\right ) - 96 \, a^{3} d \cos \left (f x + e\right )}{96 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sin(f*x+e))^3*(c+d*sin(f*x+e)),x, algorithm="maxima")

[Out]

1/96*(96*(f*x + e)*a^3*c + 72*(2*f*x + 2*e - sin(2*f*x + 2*e))*a*b^2*c + 32*(cos(f*x + e)^3 - 3*cos(f*x + e))*
b^3*c + 72*(2*f*x + 2*e - sin(2*f*x + 2*e))*a^2*b*d + 96*(cos(f*x + e)^3 - 3*cos(f*x + e))*a*b^2*d + 3*(12*f*x
 + 12*e + sin(4*f*x + 4*e) - 8*sin(2*f*x + 2*e))*b^3*d - 288*a^2*b*c*cos(f*x + e) - 96*a^3*d*cos(f*x + e))/f

________________________________________________________________________________________

Fricas [A]  time = 1.72184, size = 340, normalized size = 1.99 \begin{align*} \frac{8 \,{\left (b^{3} c + 3 \, a b^{2} d\right )} \cos \left (f x + e\right )^{3} + 3 \,{\left (4 \,{\left (2 \, a^{3} + 3 \, a b^{2}\right )} c + 3 \,{\left (4 \, a^{2} b + b^{3}\right )} d\right )} f x - 24 \,{\left ({\left (3 \, a^{2} b + b^{3}\right )} c +{\left (a^{3} + 3 \, a b^{2}\right )} d\right )} \cos \left (f x + e\right ) + 3 \,{\left (2 \, b^{3} d \cos \left (f x + e\right )^{3} -{\left (12 \, a b^{2} c +{\left (12 \, a^{2} b + 5 \, b^{3}\right )} d\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{24 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sin(f*x+e))^3*(c+d*sin(f*x+e)),x, algorithm="fricas")

[Out]

1/24*(8*(b^3*c + 3*a*b^2*d)*cos(f*x + e)^3 + 3*(4*(2*a^3 + 3*a*b^2)*c + 3*(4*a^2*b + b^3)*d)*f*x - 24*((3*a^2*
b + b^3)*c + (a^3 + 3*a*b^2)*d)*cos(f*x + e) + 3*(2*b^3*d*cos(f*x + e)^3 - (12*a*b^2*c + (12*a^2*b + 5*b^3)*d)
*cos(f*x + e))*sin(f*x + e))/f

________________________________________________________________________________________

Sympy [A]  time = 1.73381, size = 386, normalized size = 2.26 \begin{align*} \begin{cases} a^{3} c x - \frac{a^{3} d \cos{\left (e + f x \right )}}{f} - \frac{3 a^{2} b c \cos{\left (e + f x \right )}}{f} + \frac{3 a^{2} b d x \sin ^{2}{\left (e + f x \right )}}{2} + \frac{3 a^{2} b d x \cos ^{2}{\left (e + f x \right )}}{2} - \frac{3 a^{2} b d \sin{\left (e + f x \right )} \cos{\left (e + f x \right )}}{2 f} + \frac{3 a b^{2} c x \sin ^{2}{\left (e + f x \right )}}{2} + \frac{3 a b^{2} c x \cos ^{2}{\left (e + f x \right )}}{2} - \frac{3 a b^{2} c \sin{\left (e + f x \right )} \cos{\left (e + f x \right )}}{2 f} - \frac{3 a b^{2} d \sin ^{2}{\left (e + f x \right )} \cos{\left (e + f x \right )}}{f} - \frac{2 a b^{2} d \cos ^{3}{\left (e + f x \right )}}{f} - \frac{b^{3} c \sin ^{2}{\left (e + f x \right )} \cos{\left (e + f x \right )}}{f} - \frac{2 b^{3} c \cos ^{3}{\left (e + f x \right )}}{3 f} + \frac{3 b^{3} d x \sin ^{4}{\left (e + f x \right )}}{8} + \frac{3 b^{3} d x \sin ^{2}{\left (e + f x \right )} \cos ^{2}{\left (e + f x \right )}}{4} + \frac{3 b^{3} d x \cos ^{4}{\left (e + f x \right )}}{8} - \frac{5 b^{3} d \sin ^{3}{\left (e + f x \right )} \cos{\left (e + f x \right )}}{8 f} - \frac{3 b^{3} d \sin{\left (e + f x \right )} \cos ^{3}{\left (e + f x \right )}}{8 f} & \text{for}\: f \neq 0 \\x \left (a + b \sin{\left (e \right )}\right )^{3} \left (c + d \sin{\left (e \right )}\right ) & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sin(f*x+e))**3*(c+d*sin(f*x+e)),x)

[Out]

Piecewise((a**3*c*x - a**3*d*cos(e + f*x)/f - 3*a**2*b*c*cos(e + f*x)/f + 3*a**2*b*d*x*sin(e + f*x)**2/2 + 3*a
**2*b*d*x*cos(e + f*x)**2/2 - 3*a**2*b*d*sin(e + f*x)*cos(e + f*x)/(2*f) + 3*a*b**2*c*x*sin(e + f*x)**2/2 + 3*
a*b**2*c*x*cos(e + f*x)**2/2 - 3*a*b**2*c*sin(e + f*x)*cos(e + f*x)/(2*f) - 3*a*b**2*d*sin(e + f*x)**2*cos(e +
 f*x)/f - 2*a*b**2*d*cos(e + f*x)**3/f - b**3*c*sin(e + f*x)**2*cos(e + f*x)/f - 2*b**3*c*cos(e + f*x)**3/(3*f
) + 3*b**3*d*x*sin(e + f*x)**4/8 + 3*b**3*d*x*sin(e + f*x)**2*cos(e + f*x)**2/4 + 3*b**3*d*x*cos(e + f*x)**4/8
 - 5*b**3*d*sin(e + f*x)**3*cos(e + f*x)/(8*f) - 3*b**3*d*sin(e + f*x)*cos(e + f*x)**3/(8*f), Ne(f, 0)), (x*(a
 + b*sin(e))**3*(c + d*sin(e)), True))

________________________________________________________________________________________

Giac [A]  time = 1.39458, size = 205, normalized size = 1.2 \begin{align*} \frac{b^{3} d \sin \left (4 \, f x + 4 \, e\right )}{32 \, f} + \frac{1}{8} \,{\left (8 \, a^{3} c + 12 \, a b^{2} c + 12 \, a^{2} b d + 3 \, b^{3} d\right )} x + \frac{{\left (b^{3} c + 3 \, a b^{2} d\right )} \cos \left (3 \, f x + 3 \, e\right )}{12 \, f} - \frac{{\left (12 \, a^{2} b c + 3 \, b^{3} c + 4 \, a^{3} d + 9 \, a b^{2} d\right )} \cos \left (f x + e\right )}{4 \, f} - \frac{{\left (3 \, a b^{2} c + 3 \, a^{2} b d + b^{3} d\right )} \sin \left (2 \, f x + 2 \, e\right )}{4 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sin(f*x+e))^3*(c+d*sin(f*x+e)),x, algorithm="giac")

[Out]

1/32*b^3*d*sin(4*f*x + 4*e)/f + 1/8*(8*a^3*c + 12*a*b^2*c + 12*a^2*b*d + 3*b^3*d)*x + 1/12*(b^3*c + 3*a*b^2*d)
*cos(3*f*x + 3*e)/f - 1/4*(12*a^2*b*c + 3*b^3*c + 4*a^3*d + 9*a*b^2*d)*cos(f*x + e)/f - 1/4*(3*a*b^2*c + 3*a^2
*b*d + b^3*d)*sin(2*f*x + 2*e)/f